
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:replace="top::html" /> <!-- 引入样式 -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>专家管理</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<body class="fixed hold-transition skin-blue">

	<div class="wrapper">
		<!-- 引入表头 -->
		<div th:replace="tophtml::html"></div>
		<!-- 引入左边 -->
		<div th:replace="left::html"></div>

		<!-- 右侧表格部分 -->
		<div class="content-wrapper">
			<!--  -->
			<section class="content-header">
				<h1>专家管理（本人录入）<small></small></h1>
				<ol class="breadcrumb">
					<li><a href="/index"><i class="fa fa-dashboard"></i>用户中心</a></li>
					<li><a href="/person/findPersonList">专家管理</a></li>
				</ol>
			</section>
			<section class="content container-fluid">
				<!-- 提示检索条件 -->
				<p style="color: red;" th:text="${searchEmpty}"></p>
				<!-- 提示每天只能下载200条 -->
				<p style="color: red;" th:text="${max}"></p>
				<!-- 提示下载成功 -->
				<p style="color: red;" th:text="${success}"></p>
				<!-- 右侧表单部分 -->
				<form id="from1" class="form-inline" th:action="@{/person/showSelf}" method="get">
					<input type="hidden" name="pageNo" id="pageNo" th:value="${pageInfo.pageNum}"/>
					<div class="form-group">
						<label>专家类型</label> 
						<select name="type" th:field="${person.type}" class="form-control" style="width: 202px;">
							<option th:value=null>-请选择-</option>
							<option th:each="psd : ${personTypeList}" th:value="${psd.pid}" th:text="${psd.worth}"></option>
						</select>
					</div><br/>
					<div class="form-group">
                        <label>所属领域</label>
                        <span th:each="rfd : ${researchFieldDictiontryList}">
                            <label style="font-weight: lighter;">
                            	<input type="checkbox" name="researchField" th:value="${rfd.names}" th:text="${rfd.worth}" th:checked="${researchFieldArr != null ? #arrays.contains(researchFieldArr, rfd.names) : false}">
                            </label>
                        </span>
                        <span style="margin-left: 10px; color: red;">(可以多选)</span>
                        <label style="font-weight: lighter;">
                        	<input style="margin-left: 10px;" type="radio" name="a" value="3" th:checked="${person != null ? person.a == 3 : false}" >且
                        </label> 
                        <label style="font-weight: lighter;">
                        	<input style="margin-left: 5px;" type="radio" name="a" value="4" th:checked="${person != null ? person.a == 4 : false}" >或
                        </label>
                    </div>
					<div class="form-group">
                        <label>人才级别</label>
                        <span th:each="rfd : ${talentLevelListByDic}">
                        	<label style="font-weight: lighter;">
                            	<input type="checkbox" name="talentLevel" th:value="${rfd.names}" th:text="${rfd.worth}" th:checked="${talentLevelArr != null ? #arrays.contains(talentLevelArr, rfd.names) : false}">
                            </label>	
                        </span>
                        <span style="margin-left: 10px; color: red;">(可以多选)</span>
                        <label style="font-weight: lighter;">
                        	<input style="margin-left: 10px;" type="radio" name="b" value="5" th:checked="${person != null ? person.b == 5 : false}" >且
                        </label>
                        <label style="font-weight: lighter;">
                        	<input style="margin-left: 5px;" type="radio" name="b" value="6" th:checked="${person != null ? person.b == 6 : false}" >或
                        </label>
                    </div><br/>
					<div class="form-group">
						<label style="margin-left: 14.8px;">专家ID</label> 
						<input type="text" class="form-control" th:if="${person.expertNumber==null}" name="expertNumberId" th:value="${person.expertNumber}" style="width: 202px;"> 
						<input type="text" class="form-control" th:if="${person.expertNumber!=null}" name="expertNumberId" th:value="'E'+${person.expertNumber}" style="width: 202px;">
					</div>
					<div class="form-group">
						<label style="margin-left: 28.2px;">姓名</label> 
						<input name="name" type="text" th:value="${person.name}" class="form-control" style="width: 202px;"/>
					</div>
					<div class="form-group">
						<label style="margin-left: 27.8px;">单位</label> 
						<input name="unit" type="text" th:value="${person.unit}" class="form-control" style="width: 202px;"/>
					</div><br/>
					<div class="form-group">
						<label style="margin-left: 28px;">邮箱</label> 
						<input name="email" type="text" th:value="${person.email}" class="form-control" style="width: 202px;"/>
					</div>
					<div class="form-group">
						<label style="margin-left: 28.3px;">手机</label> 
						<input name="tell" type="text" th:value="${person.tell}" class="form-control" style="width: 202px;"/>
					</div>
					<div class="form-group">
						<label>专业领域</label> 
						<input name="professionaField" type="text" th:value="${person.professionaField}" class="form-control" style="width: 202px;"/>
					</div>
					<!-- 搜索按钮 -->
					<button id="sousuo" class="btn btn-primary" style="margin-left: 40px;">搜索</button>
					<!-- 重置按钮 -->
					<button type="reset" style="margin-left: 40px;" class="btn btn-primary">重置</button>
					<!-- 添加按钮 -->
					<button type="button" class="btn btn-primary" onclick="javascript:window.location.href='/person/addView'" style="margin-left: 40px;">添加</button>
					<!-- 下载按钮 -->
					<button id="xiazai" class="btn btn-primary" style="margin-left: 40px;">下载</button>
					<br/>
					<div>
                        <span class="from-group">
	                        <label>所在地区</label>
	                        <label style="font-weight: lighter;">
	                        	<input type="radio" name="domesticOrForeign" id="optionsRadios1" value="0" th:checked="${person != null ? person.domesticOrForeign == 0 : false}" style="margin-left: 1px;"> 国内
	                        </label>
	                        <label style="font-weight: lighter;">
	                        	<input type="radio" name="domesticOrForeign" id="optionsRadios2" value="1" th:checked="${person != null ? person.domesticOrForeign == 1 : false}" style="margin-left: 15px;"> 国外
	                        </label>
                        </span>
                        <span class="form-group form-country">
                        	<label style="margin-left: 124px;">国家</label>
	                        <select class="form-area" style="width: 202px;height: 35px;border-color: silver;">
	                            <option value="-1">--选择国家--</option>
	                            <option th:each="list:${countryDictiontryList}" th:value="${list.pid}" th:text="${list.worth}" th:selected="${list.pid eq country}"></option>
	                        </select>
                        </span><br/>
                        <span class="form-group form-area">
                        	<label style="margin-left: 42px;">省</label>	
	                        <select class="form-area" id="provinceId" style="width: 202px;height: 35px;border-color: silver;">
	                            <option value="-1">--选择省--</option>
	                            <option th:each="list:${provinceDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq province}"></option>
	                        </select>
                        </span>
                        <span class="form-group form-area">
                        	<label style="margin-left: 43px;">市</label>
	                        <select class="form-area" id="cityId" style="width: 202px;height: 35px;border-color: silver;">
	                            <option value="-1">--选择市--</option>
	                            <option th:each="list:${cityDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq city}"></option>
	                        </select>
                        </span>
                        <span class="form-group form-area">
                        	<label style="margin-left: 42px;">区</label>
	                        <select class="form-area" id="areaId" style="width: 202px;height: 35px;border-color: silver;">
	                            <option value="-1">--选择区--</option>
	                            <option th:each="list:${areaDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq district}"></option>
	                        </select>
                        </span>
                    </div>
				</form>
				<!-- <form th:action="@{/person/importPerson}" method="post"  enctype="multipart/form-data">
                    <table>
                        <tr>
                            <td>
                                <input type="file" name="file">
                            </td>
                            <td>
                                <button type="submit" class="btn btn-primary">导入</button>
                            </td>
                        </tr>
                    </table>
                </form> -->
				<!-- 右侧列表部分 -->
				<div class="box">
					<div class="box-header with-border">
						<h3 class="box-title">
							<button class="btn btn-primary" id="batchFocus">批量关注</button>
						</h3>
					</div>
					<div class="box-body">
						<table class="table table-bordered">
							<tbody th:with="onJobId=${personRetireDictiontryList.get(0).pid}">
								<tr>
									<th><input id="all" type="checkbox"/></th>
									<th>专家ID</th>
									<th>姓名</th>
									<th>单位</th>
									<th>专家类型</th>
									<th>专业领域</th>
									<th>录入人</th>
									<th>操作</th>
								</tr>
								<tr th:each="person, stat : ${pageInfo.list}" th:with="isNotJob=${person.retireStatus} and ${onJobId != person.retireStatus}" th:class="${isNotJob} ? butt-gray" th:title="${isNotJob} ? 专家非在职">
									<td>
										<input type="checkbox" class="matched" th:value="'objectType='+${person.pid}"
											   th:disabled="${not #lists.isEmpty(subPersonIdList)} and ${#lists.contains(subPersonIdList, person.pid)} ? butt-gray"/>
									</td>
		                            <td title="查看专家详情">
		                            	<a th:href="@{/person/personDetails(pid=${person.pid})}" th:text="${'E'+person.expertNumber}"></a>
		                            </td>
		                            <td th:text="${person.name}"></td> 
		                            <td th:text="${not #strings.isEmpty(person.unit)} and ${#strings.length(person.unit)} > 7 ? '*****' + ${#strings.substring(person.unit, 5, 7)}+'...' : ${person.unit}"></td>
		                            <td th:text="${person.typeWorth}"></td>
		                            <td th:text="${not #strings.isEmpty(person.professionaField)} and ${#strings.length(person.professionaField)} > 10 ? ${#strings.substring(person.professionaField, 0, 10)}+'...' : ${person.professionaField}" 
                            			th:title="${person.professionaField}"></td>
                					<td th:text="${person.collectPersonName}"></td>
		                            <td th:with="isSubed=${#lists.contains(subPersonIdList, person.pid)}">
		                            	<a th:href="@{'/person/mateDemandView?pid='+${person.pid}}" title="专家匹配需求">匹配</a>|
		                            	<a th:href="@{/person/mateConference(pid=${person.pid})}">参会</a>|
		                            	<a th:href="@{/person/updateView(pid=${person.pid})}">修改</a><br>
		                            	<a th:href="@{/project/showHolderAddProject(personId=${person.pid})}" title="作为持有人关联项目">关联项目</a>|
		                            	<a th:href="@{/person/downLoadPer(pid=${person.pid})}">下载</a>|
		                            	<a th:if="${isSubed}" th:id="${person.pid}" href="javascirpt:void(0)" th:onclick="'javascript:delSub1(\''+${person.pid}+'\',4)'">取消关注</a>
		                            	<a th:unless="${isSubed}" th:id="${person.pid}" href="javascirpt:void(0)" th:onclick="'javascript:subscribe1(\''+${person.pid}+'\',4)'">关注</a>
		                            </td>
		                        </tr>
							</tbody>
						</table>
					</div>
					<!-- 页脚、分页 -->
					<div th:replace="page::html"></div>	
					<!-- 返回按钮 -->
					<div style="width:240px; height: 30px; position:fixed;left:790px;bottom:10px;">
						<button type="button" class="btn btn-primary" onclick="window.history.go(-1)">返回上一级</button>
					</div>
				</div>	
			</section>
		</div><!-- 右侧部分结束 -->
		
		<!-- 引入页脚 -->
		<div th:replace="footer::html"></div>
		<div class="control-sidebar-bg"></div> 
	</div>
	
	<!-- 引入js -->
	<div th:replace="bottom::html" ></div>
</body>
	<script type="text/javascript" th:inline="javascript">
		//批量关注
		batchFocus([[@{/person/addSubscribe}]]);
		
		//改变form表单的提交路径
		$(document).on('click', '#sousuo', function () {
			var action1 = '/person/showSelf';
			$('#from1').attr('action',action1).submit();
		})
		
		//改变form表单的提交路径
		$(document).on('click', '#xiazai', function () {
			var action1 = '/person/downLoadPers';
			$('#from1').attr('action',action1).submit();
		})
	</script>
</html>